package com.example.qy137login.controller;

import com.example.qy137login.service.StaffService;
import com.example.qy137login.utils.Result;
import com.example.qy137login.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: qy137-login
 * @description: controller层
 * @author: 王子鑫
 * @create: 2021-08-27 18:31
 **/
@RestController
@RequestMapping("login")
@CrossOrigin
public class LoginController {
    @Autowired
    private StaffService staffService;

    @PostMapping
    public Result loginByUsernameAndPassword(@RequestBody LoginVo loginVo){
        Result result = staffService.loginByUsernameAndPassword(loginVo.getUsername(), loginVo.getPassword());
        return result;
    }
}
